package studentInterface;

import java.io.IOException;
import java.rmi.RemoteException;
import java.sql.SQLException;

import javax.naming.Context;
import javax.naming.InitialContext;


public class TestClientStudying {
	private static IStudyingService iStudying;
	Object obj;
	private static IStudentService iStudent; 
	
	public TestClientStudying() {
		String url = "rmi://localhost:5555/RegisterCourseServer";
		Context ctx;
		try {
			ctx = new InitialContext();
			Object obj = ctx.lookup(url);
			iStudying = (IStudyingService)obj;
			iStudent = (IStudentService)obj;
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		new TestClientStudying();
		//txtAmount.getText()
		Double amount = Double.parseDouble("a");
		try {
			// just example
			iStudent.getStudentInfoByID("txtStudentID.getText()");
			iStudying.getOverAllMarkOfStudent("txtStudentID.getText()");
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}